php variable outside foreach

30

$categorySize = array();

<?php  $categories = Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*'); 
         foreach ($categories as $category): 
         $categorySize = $category->getSize_chart(); 
         print_r ($categorySize); 
         endforeach;
    ?>

print_r($categorySize) //Now you can get it outside the loop 
$pages = get_pages();
$pagee = array();
foreach ($pages as $page) {
  $pagee[] = $page->post_title;
}
echo implode(",",$pagee);

Comments

Submit
0 Comments